<?php
if(!isset($_SESSION)) 
{ 
session_start(); 
} 
include '../connection/connection.php';

$monitorid = $_REQUEST['monitorid'];
$idcamera = $_REQUEST['idcamera'];
$idposcamera = $_REQUEST['idposcamera'];
	
$sql = mysql_query("SELECT  fa.* FROM favourite fa, monitor m 
	WHERE fa.monitor_ID = m.Monitor_ID AND (fa.pos = '$idposcamera' or fa.camera_ID = '$idcamera' ) AND m.Monitor_ID = $monitorid GROUP BY m.Monitor_ID",$connection);

$kq = "";
if(mysql_num_rows($sql) != "" )
	 {
	  $kq ="no";
	 }
	 else
	 {
	 	$kq="yes";
	 }
	 
?>
<input type="hidden" id="idcameraposthidden" name="idcameraposthidden" value="<?=$kq?>" />
<?php mysql_close($connection);?>